/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mscs.server.admin.logic;

import java.util.ArrayList;
import java.util.List;
import mscs.data.IFileDataStore;
import mscs.data.IPersonProxy;
import mscs.data.pojo.Person;

/**
 *
 * @author Administrator
 */
public class DeletePersonUtil implements IDeletePersonUtil{
    private IFileDataStore fds = new IPersonProxy();
    private ArrayList<Person> allList ;
    
    public DeletePersonUtil(){
        allList =(ArrayList<Person>) fds.getObjects();
    }
    public boolean remove(Person person) {
        for(int i=0; i<allList.size(); i++){
            if(person.getId() == allList.get(i).getId()){
                allList.remove(i);
                fds.update(allList);
                return true;
            }
        }
        return false;
        
    }
    
}
